package com.jy.controller;


import com.jy.entity.CwAdvertising;
import com.jy.entity.CwLsparking;
import com.jy.entity.PageInfo;
import com.jy.entity.R;
import com.jy.service.ICwAdvertisingService;
import com.jy.service.ICwLsparkingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 临时车位费 前端控制器
 * </p>
 *
 * @author WeiQuan
 * @since 2022-11-14
 */
@RestController
@RequestMapping("/lsparking")
public class CwLsparkingController {

    @Resource
    private ICwLsparkingService IC;
//      查询临时停车费
    @GetMapping("/lstcf")
    public R lstcf(PageInfo pageInfo){
        System.out.println("=========   ==="+pageInfo.toString());
        PageInfo pageInfo1 = IC.allCwLsparking(pageInfo);
        return R.result(pageInfo1);
    }
//    新增临时停车费
    @PostMapping("/addlstcf")
    public R addlstcf(@RequestBody CwLsparking cwLsparking){
        int lstcf = IC.addcwlsparking(cwLsparking);
        return R.result(lstcf);
    }
//    删除临时停车费
    @GetMapping("/dellstcf/{lid}")
    public R dellstcf(@PathVariable("lid") Integer lid){
        int fid = IC.delCwLsparking(lid);
        return R.result(fid);
    }
    //    修改临时停车费
    @PostMapping("/uplstcf")
    public R uplstcf(@RequestBody CwLsparking cwLsparking){
        int lstcf = IC.upCwLsparking(cwLsparking);
        return R.result(lstcf);
    }
}
